﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="采购材料中标信息.aspx.cs" Inherits="syc.Sale.采购材料中标信息" %>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server">
<asp:Label ID="BillID" runat="server" Text="" Visible="false"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
SelectCommand="select @名称=名称,@编号=isnull(编号,''),@年度=年度,@季度=季度,@日期=日期,@备注=isnull(备注,'') from 采购材料标书 where ID=@ID;
SELECT t2.品名,t2.规格,t2.单位,t3.名称 as 中标单位,t1.数量,t1.单价,t1.备注,t4.编号 as 合同编号 FROM 采购材料中标 t1
left outer join 物料品种 t2 on t2.ID=t1.材料ID
left outer join 材料供货单位 t3 on t3.ID=t1.供货ID
left outer join 采购材料合同 t4 on t4.ID=t1.合同ID
where t1.标书ID=@ID"
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    onselected="SqlDataSource1_Selected" >
<SelectParameters>
<asp:Parameter Name="ID" DbType="Int32" Size="4" DefaultValue="0" />
<asp:Parameter Name="名称" DbType="String"  Size="60" Direction="Output"/>
<asp:Parameter Name="编号" DbType="AnsiString"  Size="10" Direction="Output"/>
<asp:Parameter Name="年度" DbType="Int32" Size="4" Direction="Output"/>
<asp:Parameter Name="季度" DbType="Int32" Size="4" Direction="Output" />
<asp:Parameter Name="日期" DbType="Date"  Size="3" Direction="Output"/>
<asp:Parameter Name="备注" DbType="String"  Size="100" Direction="Output"/>
</SelectParameters>
</asp:SqlDataSource>


<div id="wintop" class="wintop" style="display:none;">辅料采购中标信息</div>
<asp:Panel ID="Panel1" runat="server" CssClass="panel">
<input type="button" value="导出Excel" class="button" onclick="Export();" />
<input type="button" value="关 闭" class="button" onclick="parent.swin2_close();" />
</asp:Panel>
<div id="content" style="padding:10px;text-align:center;">
<style>
tr{height:20pt;}
td{border:0.5pt solid #000000;text-align:center;font-size:11pt;}
td.nb{border:none}
</style>
<table id=mt border="0" cellpadding="0" style="border-collapse: collapse">
<tr style="height:30pt">
<td class=nb colspan=8 style="font-size:18pt; letter-spacing:11pt;"><b><asp:Label ID="MingCheng" runat="server" Text=""></asp:Label></b></td>
</tr>
<tr>
<td colspan=2 style=text-align:left;>&nbsp;标书编号：<asp:Label ID="BianHao" runat="server" Text=""></asp:Label></td>
<td colspan=3><asp:Label ID="NianDu" runat="server" Text=""></asp:Label><asp:Label ID="JiDu" runat="server" Text=""></asp:Label></td>
<td colspan=2><asp:Label ID="Date1" runat="server" Text=""></asp:Label></td>
<td colspan=1 style=text-align:right;>SYC/&nbsp;</td>
</tr>

<tr style="height:30pt">
<td>备注：</td>
<td colspan=7><asp:Label ID="BeiZhu" runat="server" Text=""></asp:Label></td>
</tr>
<tr>
<td colspan=8 style=text-align:left;><b>&nbsp;中标明细</b></td>
</tr>
<tr>
<td style=width:90pt;>材料类别</td>
<td style=width:90pt;>规格</td>
<td style=width:30pt;>单位</td>
<td style=width:70pt;>数量</td>
<td style=width:70pt;>单价(元)</td>
<td style=width:90pt;>中标单位</td>
<td style=width:90pt;>合同编号</td>
<td style=width:110pt;>备注</td>
</tr>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<tr>
<td><%# Eval("品名") %></td>
<td><%# Eval("规格") %></td>
<td><%# Eval("单位") %></td>
<td><%# Eval("数量") %></td>
<td><%# Eval("单价") %></td>
<td><%# Eval("中标单位") %></td>
<td><%# Eval("合同编号")%></td>
<td><%# Eval("备注")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</div>
</form>

<form id="form2" method="post" action="/PageExport.ashx">
<input type="hidden" name="filename" value="中标信息.xls" />
<input type="hidden" name="content" value="" />
</form>

<script >
    var mt = document.getElementById("mt");
    var row, i, j;
    for (i = mt.rows.length; i < 15; i++) {
        row = mt.insertRow(-1);
        for (j = 0; j < 8; j++) {
            row.insertCell(-1);
        }
    }
    //导出Excel
    function Export() {
        form2.content.value =
"<html xmlns:o='urn:schemas-microsoft-com:office:office'\nxmlns:x='urn:schemas-microsoft-com:office:excel'\nxmlns='http://www.w3.org/TR/REC-html40'>\n<head>\n<meta http-equiv=Content-Type content='text/html; charset=utf-8'>\n<style>\n<!--table\n@page\n{mso-header-data:;\nmso-footer-data:;\nmargin:.79in .31in .79in .31in;\nmso-header-margin:.51in;\nmso-footer-margin:.51in;\nmso-page-orientation:landscape;\nmso-horizontal-page-align:center;\n}\n-->\n</style>\n<!--[if gte mso 9]><xml>\n<x:ExcelWorkbook>\n<x:ExcelWorksheets>\n<x:ExcelWorksheet>\n<x:Name>中标信息</x:Name>\n<x:WorksheetOptions>\n<x:DefaultRowHeight>285</x:DefaultRowHeight>\n<x:Print>\n<x:ValidPrinterInfo/>\n<x:Scale>100</x:Scale>\n<x:PaperSizeIndex>9</x:PaperSizeIndex>\n<x:HorizontalResolution>200</x:HorizontalResolution>\n<x:VerticalResolution>200</x:VerticalResolution>\n</x:Print>\n<x:Selected/>\n<x:Panes>\n<x:Pane>\n<x:Number>3</x:Number>\n<x:ActiveRow>0</x:ActiveRow>\n<x:ActiveCol>0</x:ActiveCol>\n</x:Pane>\n</x:Panes>\n</x:WorksheetOptions>\n</x:ExcelWorksheet>\n</x:ExcelWorkbook>\n</xml><![endif]-->\n</head>\n<body>"
            + document.getElementById("content").innerHTML +"</body></html>";
        form2.submit();
    }
</script>
</body>
</html>
